// Copyright (c) 2014 Jonathan Magnan (http://jonathanmagnan.com).
// All rights reserved (http://jonathanmagnan.com/extension-methods-library).
// Licensed under MIT License (MIT) (http://zextensionmethods.codeplex.com/license).

#if EXTENSIONMETHODS_WITHNAMESPACE
namespace JHSoft.Extension.ExtensionMethods
{
#endif
#if EXTENSIONMETHODS_INTERNAL
    internal static partial class CharExtensions
#else
    public static partial class CharExtensions
#endif
    {
        /// <summary>
        ///     A char extension method that repeats a character the specified number of times.
        /// </summary>
        /// <param name="this">The @this to act on.</param>
        /// <param name="repeatCount">Number of repeats.</param>
        /// <returns>The repeated char.</returns>
        /// <example>
        ///     <code>
        ///           using Microsoft.VisualStudio.TestTools.UnitTesting;
        ///           using JHSoft.Extension.ExtensionMethods;
        ///           
        ///           namespace ExtensionMethods.Examples
        ///           {
        ///               [TestClass]
        ///               public class System_Char_Repeat
        ///               {
        ///                   [TestMethod]
        ///                   public void Repeat()
        ///                   {
        ///                       // Type
        ///                       char @this = &apos;F&apos;;
        ///           
        ///                       // Examples
        ///                       string result = @this.Repeat(3); // return &quot;FFF&quot;;
        ///           
        ///                       // Unit Test
        ///                       Assert.AreEqual(&quot;FFF&quot;, result);
        ///                   }
        ///               }
        ///           }
        ///     </code>
        /// </example>
        public static string Repeat(this char @this, int repeatCount)
        {
            return new string(@this, repeatCount);
        }
    }
#if EXTENSIONMETHODS_WITHNAMESPACE
}
#endif